package cn.cvs.service.adoptanimal;

import cn.cvs.dao.adoptanimal.AdoptanimalMapper;
import cn.cvs.pojo.Adoptanimal;
import cn.cvs.pojo.Pet;
import cn.cvs.pojo.User;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class AdoptanimalServiceImpl implements AdoptanimalService{

    @Resource
    private AdoptanimalMapper adoptanimalMapper;

    @Override
    public List<Adoptanimal> queryPageList(Integer status,String date, Integer pageIndex, Integer pageSize) {
        int pageBegin = (pageIndex-1)*pageSize;
        return adoptanimalMapper.list(status,date,pageBegin,pageSize);
    }

    @Override
    public int count(Integer status,String date) {
        return adoptanimalMapper.count(status,date);
    }

    @Override
    public int insert(Adoptanimal adoptanimal) {
        return adoptanimalMapper.insert(adoptanimal);
    }

    @Override
    public int modifyById(Adoptanimal adoptanimal) {
        return adoptanimalMapper.updateById(adoptanimal);
    }

    @Override
    public Adoptanimal queryById(Integer id) {
        return adoptanimalMapper.selectById(id);
    }

    @Override
    public List<Pet> selectPetList() {
        return adoptanimalMapper.selectPetList();
    }

    @Override
    public List<User> selectUserList() {
        return adoptanimalMapper.selectUserList();
    }

    @Override
    public List<Adoptanimal> selectNum() {
        return adoptanimalMapper.selectNum();
    }
}
